#!/bin/bash

SCRIPT_DIR=$(cd `dirname $0` && pwd)
cd $SCRIPT_DIR

# Compress the file
# upx ./_install/*

mkdir -p ../../build/home/yi-hack/bin/
mkdir -p ../../build/rootfs/bin/
mkdir -p ../../build/rootfs/sbin/
mkdir -p ../../build/rootfs/usr/bin/

arm-linux-gnueabihf-strip ./_install/dropbearmulti
rsync -a ./_install/dropbearmulti ../../build/home/yi-hack/bin/

ln -fs /home/yi-hack/bin/dropbearmulti ../../build/rootfs/bin/dbclient
ln -fs /home/yi-hack/bin/dropbearmulti ../../build/rootfs/bin/dropbearconvert
ln -fs /home/yi-hack/bin/dropbearmulti ../../build/rootfs/bin/dropbearkey
ln -fs /home/yi-hack/bin/dropbearmulti ../../build/rootfs/bin/scp
ln -fs dbclient ../../build/rootfs/bin/ssh

ln -fs /bin/dbclient ../../build/rootfs/usr/bin/dbclient

ln -fs /home/yi-hack/bin/dropbearmulti ../../build/rootfs/sbin/dropbear
